﻿using System;
using System.Collections.Generic;
using System.ComponentModel.DataAnnotations;
using System.Linq;
using System.Runtime.Serialization;
using System.Text;
using System.Threading.Tasks;
using KC.Enums.Core;
using ProtoBuf;

namespace KC.DTO.Core
{
    [Serializable, DataContract(IsReference = true)]
    [ProtoContract(ImplicitFields = ImplicitFields.AllPublic)]
    //[ProtoInclude(100, typeof(CustomerExtInfoDTO))]
    //[ProtoInclude(101, typeof(CustomerExtInfoProviderDTO))]
    //[ProtoInclude(102, typeof(ServiceAttributeDTO))]
    //[ProtoInclude(104, typeof(ServiceProviderAttributeDTO))]
    //[ProtoInclude(105, typeof(CompanyProfileDTO))]
    public abstract class PropertyAttributeBaseDTO : EntityDTO
    {
        public PropertyAttributeBaseDTO()
        {
            CanEdit = true;
            DataType = Framework.Base.AttributeDataType.String;
        }

        [DataMember]
        public int PropertyAttributeId { get; set; }

        [DataMember]
        public Framework.Base.AttributeDataType DataType { get; set; }
        //[DataMember]
        //public string DataTypeStr
        //{
        //    get { return DataType.ToDescription(); }
        //}

        [MaxLength(256)]
        [DataMember]
        public string Name { get; set; }

        [DataMember]
        public string Value { get; set; }

        [DataMember]
        public string Value1 { get; set; }

        [DataMember]
        public string Value2 { get; set; }

        [DataMember]
        public bool CanEdit { get; set; }

        [DataMember]
        public bool IsProviderAttr { get; set; }
        public string IsProviderAttrStr
        {
            get
            {
                string str = IsProviderAttr ? "是" : "否";
                return str;
            }
        }

        [DataMember]
        public int Index { get; set; }
    }
}
